﻿<UserControl x:Class="SharePointCSVImporter.RuleEditors.LookupReplace"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="320" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="45" />
            <RowDefinition  />
  
        </Grid.RowDefinitions>
        <TextBlock  Margin="10" TextDecorations="Underline" FontSize="14" HorizontalAlignment="Center"  >Lookup Replace</TextBlock>
        <Button Content="Instructions" Grid.Column="1" Name="ShowInstructionButton"  VerticalAlignment="Center"  Click="ShowInstructionButton_Click"  >

        </Button>

        <Popup Name="InstructionsPopup" >
            <Border BorderBrush="Black" BorderThickness="2">
                <Border.Effect>
                    <DropShadowEffect />
                </Border.Effect>
                <Grid Background="White">
                    <Grid.RowDefinitions >
                        <RowDefinition Height="18" />
                        <RowDefinition Height="130" />
                    </Grid.RowDefinitions>
                    <Button Name="InstructionCloseBtn" Click="InstructionCloseBtn_Click" Content="X" HorizontalAlignment="Right" Width="16" Height="18" VerticalAlignment="Top"></Button>
                    <TextBlock Grid.Row="1"  Width="300" TextWrapping="Wrap" Grid.ColumnSpan="2" Margin="10"><Underline> Syntax for lookup:</Underline>  System performs key value replaces with this column's value.  Enter a lookup value(key) in quotation marks then an equal sign followed by a value(value) you want to replace with in quotation marks.
     Seperate multiple lookups with a semi-colon. i.e. <Italic> "US"="USA";"JP"="Japan"</Italic>  to replace US in CSV and save as USA and JP with Japan. If there is no lookup value to match, system will use original csv value - to override this include "Default"=""
                    </TextBlock>
                </Grid>
            </Border>
        </Popup>
      
        <Border Margin="10" Grid.Row="1" Grid.ColumnSpan="2" BorderBrush="Gray" BorderThickness="2">
            <TextBox Name="LookupValues" AcceptsReturn="True" TextWrapping="Wrap"  TextChanged="LookupValues_TextChanged" ></TextBox>
        </Border>

    </Grid>
</UserControl>
